const fs = require('fs')
fs.readFile('../buffer/decode.js', 'utf8', (err, data) => {
    if (err) throw err;
    console.log(data)
})
const content = Buffer.from('this is a 你好啊 fs buffer')
fs.writeFile('./text.txt', content, {
    encoding: 'utf8'
}, err => {
    if (err) throw err
    console.log('done')
})

const data = fs.readFileSync('../event/once.js', 'utf8')
console.log(data + '\n\n\n')

//删除文件
fs.unlink('./text',err=>{
    if(err)throw err
})
